<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
 div{
        width: 100px;
        height: 100px;
        background-color: rgb(115, 255, 0);
    }


    </style>
   
</head>
<body>

    <div>

    </div>
    
    <script>
        let  div=document.querySelector("div");
        div.addEventListener("mouseleave",function(){
            div.style.backgroundColor="blue";
        })
    </script>
</body>
</html>